{include file='../header.tpl'}

<div class="container">

    <div class="sidebar">
        <div class="well">
            <ul>
            {foreach from=$latestPosts item=post}
                <li><a href="/post/read/{$post->getId()}">{$post->getTitle()}</a></li>

            {/foreach}
            </ul>
        </div>
    </div>
    <div class="content">
        <!-- Main hero unit for a primary marketing message or call to action -->
        <div class="row category-hero">
            <span class="span6">
                <h1>{$currentCategory}</h1>
            </span>
            <span>
                <div id="subscribe" onclick="addCategorySubscription('{$currentCategory}')" class="{if $userIsSubscribed}hide{/if} btn success medium btn-hero">Abonneer je op deze categorie &raquo;</div>
                <div id="unsubscribe" onclick="removeCategorySubscription('{$currentCategory}')" class="{if !$userIsSubscribed}hide{/if} btn danger medium btn-hero">Meld je af voor deze categorie &raquo;</div>
                <a href="/post/create" class="btn info medium btn-hero">Maak nu een post! &raquo;</a>
            </span>
        </div>

        <!-- Example row of columns -->
        <div class="row">
        {foreach from=$latestPosts item=post}
            <div class="span-one-third">
                <h2>{$post->getTitle()}</h2>
                <h6>Door: {$post->getAuthor()} ({$post->getAuthor()->getType()})</h6>

                <p>{$post->getContent()|substr:0:250}...</p>

                <p><a class="btn" href="/post/read/{$post->getId()}">Lees meer &raquo;</a></p>
            </div>
        {/foreach}

        </div>

    {include file='../footer.tpl'}